package demo3;

/**
 * @Author 12629
 * @Description：
 */
interface IShape {
    void draw();
    default void func() {
        System.out.println("faa");
    }
    /*
    int COUNT = 10;

    static void func2() {
        System.out.println("fafa");
    }*/
}
abstract class A implements IShape{
    public abstract void func2();
}
class B extends A {

    @Override
    public void draw() {

    }

    @Override
    public void func2() {

    }
}

class Rect implements IShape {
    @Override
    public void draw() {
        System.out.println("画一个矩形");
    }

    @Override
    public void func() {
        System.out.println("重写了func");
    }
}
class Flower implements IShape {
    @Override
    public void draw() {
        System.out.println("画一朵花！");
    }
}

public class Test {
    public static void drawMap(IShape shape) {
        shape.func();
    }
    public static void main(String[] args) {
        //IShape shape = new IShape();
        drawMap(new Flower());
        drawMap(new Rect());
        //IShape shape = new Flower();
    }
}
